package com.web.controller;

import org.apache.log4j.Logger;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/index")
public class IndexController {

	protected static Logger logger = Logger.getLogger(IndexController.class);
	
	@RequestMapping("/main")
	public ModelAndView index(HttpServletRequest request,HttpServletResponse response) throws Exception {
		
		long start = System.currentTimeMillis();
		ModelAndView mv = new ModelAndView("index/main");
		response.setContentType("text/html;charset=utf-8");
		long end = System.currentTimeMillis();
		
		logger.info("IndexController main "+ Long.toString(end - start));

		return mv;
	}
	
	
	@RequestMapping("/login")
	public ModelAndView login(HttpServletRequest request,HttpServletResponse response) throws Exception {
		
		long start = System.currentTimeMillis();
		ModelAndView mv = new ModelAndView("index/main");
		response.setContentType("text/html;charset=utf-8");
		long end = System.currentTimeMillis();
		
		logger.info("IndexController main "+ Long.toString(end - start));

		return mv;
	}
	
	
	@RequestMapping("/center")
	public ModelAndView center(HttpServletRequest request,HttpServletResponse response) throws Exception {
		
		long start = System.currentTimeMillis();
		ModelAndView mv = new ModelAndView("index/main");
		response.setContentType("text/html;charset=utf-8");
		long end = System.currentTimeMillis();
		
		logger.info("IndexController main"+ Long.toString(end - start));
		return mv;
	}
	
}

    
